
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="net.comm.common.GlbFinal" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<TITLE>${theForm.title}邮件内容:i友邻社区</TITLE>
	<link rel="stylesheet" type="text/css" href="${cpath}/css/main.css" />
	<link rel="stylesheet" type="text/css" href="${cpath}/css/layout.css" />
	<link rel="stylesheet" type="text/css" href="${cpath}/css/leftmenu.css" />
	<link rel="stylesheet" type="text/css" href="${cpath}/css/msg.css" />
</head>
<body>

<!-- LOGO和菜单栏 开始 -->
<%@ include file="/menu.jsp"%>
<!-- LOGO和菜单栏 结束 -->
<!-- 通用导航 开始 -->
<%@ include file="/nav.jsp"%>
<DIV id="mainBody"><!-- 内容栏 -->

<%@ include file="/leftmenu.jsp"%><!-- 通用菜单 -->

<!-- ==============================框架内内容========================================= --><!-- 中 -->
<DIV class=chsh_mid><!-- 中间切换内容 -->
<DIV class=chsh_msg>
<H2><B class=l1></B><B class=l2></B><B class=l3></B><B class=l4></B>
<DIV class=title>
<UL>
	<LI><SPAN>
		<A class=on  href="${cpath}/webmsg.do?action=list&qryReceiver=${userID}">收件箱</A>
	</SPAN> </LI>
	<LI><SPAN>
		<A href="${cpath}/webmsg.do?action=list&qrySender=${userID}">发件箱</A>
	</SPAN> </LI>
	</UL></DIV></H2>

<DIV class=content>

<FORM id=msgForm name=msgForm action='${cpath}/msg.do' method=post>
<DIV class=mail_readtit>
<DL>
  <DT><SPAN>&nbsp;&nbsp;时间：${myfn:formatMDHM(theForm.stime)}</SPAN>${theForm.seqID}#&nbsp;${myfn:getMsg("MSG_TYPE",theForm.mtype)}</DT>
		<DD><SPAN><A href="javascript:confirm_delete('${theForm.seqID}');">删除</A>
		&nbsp;&nbsp;</SPAN>
		收件人：<A style="COLOR: red; TEXT-DECORATION: underline" href="${cpath}/user.do?action=gethome&userID=11" target=_blank>${myfn:getUserNick(theForm.sender)}</A>
		</DD>

</DL></DIV>
<DIV class=mail_read>
<DL>
	<DT><A href="${cpath}/users.do?action=home&userID=${theForm.sender}" target=_blank><IMG class=imgWhite height=50 alt="" src="${myfn:getUserPic(theForm.sender)}" width=50 border=0></A><BR> <A href="${cpath}/users.do?action=home&userID=${theForm.sender}" target=_blank>${myfn:getUserNick(theForm.sender)}</A> <BR></DT>
   <DD >${theForm.title}<br>
	${theForm.msg}
	<!--<em><a href="#" onclick="javascript:msgsubmit();">接受</a></em>
	<em><a href="#" onclick="javascript:msgsubmit();">不接受</a></em>-->
   </DD>
   </DL>
	<H3>
	<c:if test="${theForm.nextIsExist == '1'}">
	<SPAN>
	<c:if test="${theForm.prevIsExist == '1'}">
	<A href="javascript:domsg('detail','${msglist[2].seqID}');">下一封</A>
	</c:if>
	<c:if test="${theForm.prevIsExist != '1'}">
	<A href="javascript:domsg('detail','${msglist[1].seqID}');">下一封</A>
	</c:if>	
	</SPAN>
	</c:if>
	<c:if test="${theForm.prevIsExist == '1'}">
	<SPAN>
	<A href="javascript:domsg('detail','${msglist[0].seqID}');">上一封</A>
	</SPAN>	
	</c:if>
	</H3>
		<INPUT type=hidden name='qrySender'		value='${theForm.qrySender}'>
		<INPUT type=hidden name='qrySendertype' value='${theForm.qrySendertype}'>
		<INPUT type=hidden name='qryReceiver'	value='${theForm.qryReceiver}'>
		<INPUT type=hidden name='qryMtype'		value='${theForm.qryMtype}'>
		<INPUT type=hidden name='qryMtype'		value='${theForm.qryMtype}'>
		<INPUT type=hidden name='qrySeqID'		value='${theForm.qrySeqID}'>
		<INPUT type=hidden name='seqID'			value='${theForm.seqID}'>

		<!-- action字段,用于映射Action中的相关方法,name的值必须使用ACTION常量 -->
		<input type="hidden" name="action" value="${theForm.action}">
</form>

</DIV>
<!-- 给我写信 {{{ -->
<c:if test="${theForm.mtype == '1'|| theForm.mtype == '2'}">
<DIV class=mail_report>
<h4><em>等你回复</em><SPAN>&nbsp;</SPAN></h4>
<dl >
<form name="msgReplyForm" id="msgReplyForm" action="${cpath}/msg.do?action=send" method="post">
<dd><textarea style="width: 450px; height: 121px;" id="msg" name="msg" maxlength="200" ></textarea></dd>
<dd ><em><I><a href="#" onclick="javascript:msgsubmit();">回复</a></I></em></dd>
<input type="hidden" name="receiver" value="${theForm.sender}" />
<input type="hidden" name="sendertype" value="1" />
<input type="hidden" name="title" value="${theForm.title}的回复" />
<input type="hidden" name="sender" value="${theForm.mtype}" />
<input type="hidden" name="sender" value="${theForm.receiver}" />
</form>
</dl>
</DIV>
</c:if>

<DIV class=app05><!-- 广告位 --></DIV></DIV>
<B class="l4 b2"></B><B class="l3 b2"></B><B class="l2 b2"></B><B class=l1></B></DIV></DIV>
<!-- ==============================框架内内容========================================= --><!-- 右 -->
<DIV class=chsh_right><!--矩形1-->
<DIV class=app03></DIV>

<DIV class=chsh_partyr>
<B class=l1></B><B class="l2 b3"></B><B class="l3 b3"></B><B class="l4 b3"></B>
<DIV class=content>
	<H2>社区公告</H2>
	<DL>
	<DD>最新</DD>
	<DD>最新</DD>
	</DL>
</DIV>
<B class="l4 b2"></B><B class="l3 b2"></B><B class="l2 b2"></B><B class=l1></B>
</DIV>

</DIV><!-- 中 右 内容结束 --></DIV><!-- 通栏广告 开始 -->
<DIV class="container confix">
<DIV class=app04></DIV></DIV><!-- 通栏广告 结束 --><!-- 标准尾 -->

</BODY></HTML>

<SCRIPT type=text/javascript>

	function domsg(act, id)
	{
			var form = document.msgForm;

			var action = form['action'];
			action.value = act;
			
			var qrySeqID = form['qrySeqID'];
			qrySeqID.value = id;
		
			form.submit();
	}

	function reply()
	{

		document.getElementById('msg').select();
	}
	function confirm_delete(msgId)
	{
		if (!confirm("您确定要删除这封邮件吗？"))
		{
			return;
		}
		var form = document.msgForm;

		var action = form['action'];
		var seqID = form['seqID'];

		action.value = "del";
		seqID.value = msgId;
		
		form.submit();
	}
	function is_login()
	{
		userID = '${userID}';
		if(userID == "")
			return false;
		return true;
	}

	function msgsubmit()
	{
		var form = document.msgReplyForm;
		var sender = form['sender'];
		var receiver = form['receiver'];
	
		if(!is_login() || sender.value == "" || receiver.value == "" ){
			alert('请登陆');
			return false;
		}
		if(document.getElementById('msg').value == ''){
			alert('内容不能为空');
			return false;
		}
		if(document.getElementById('msg').value.length > 200){
			alert('内容超长');
			return false;
		}
		document.getElementById('msgReplyForm').submit();
	}
</SCRIPT>